package com.atguigu.realtime.utils;

import java.util.ResourceBundle;

/**
 * Created by Smexy on 2022/7/18
 */
public class PropertiesUtil {

    //读取配置文件，将读到的信息封装为一个Properties(map)

    /*
        ResourceBundle.getBundle: 读取类路径下 以 xx.properties命名的文件。传入xxx
     */
    private static ResourceBundle props = ResourceBundle.getBundle("config");

    public static String getProperty(String name){

        return  props.getString(name);

    }

    public static void main(String[] args) {

        System.out.println(getProperty("es.nodes"));

    }


}
